home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_10 / PlaceObject2_404_183 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  3.3 KB  |  115 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipTICUS")
  3.    {
  4.       if(_currentframe == 1)
  5.       {
  6.          if(started == false)
  7.          {
  8.             _Y = _Y + yspeed;
  9.             if(_Y > 100)
  10.             {
  11.                started = true;
  12.             }
  13.          }
  14.          else
  15.          {
  16.             timer -= 1;
  17.             if(timer <= 0 && lc._currentframe == 1)
  18.             {
  19.                timer = 40;
  20.                duplicateMovieClip(_root.bulE,"enmBul" + _root.nmbr,16384 + _root.nmbr);
  21.                _root["enmBul" + _root.nmbr]._x = _X - 20;
  22.                _root["enmBul" + _root.nmbr]._y = _Y + 75;
  23.                _root["enmBul" + _root.nmbr].xspeed = -3;
  24.                _root["enmBul" + _root.nmbr].yspeed = 10;
  25.                _root.nmbr = _root.nmbr + 1;
  26.                duplicateMovieClip(_root.bulE,"enmBul" + _root.nmbr,16384 + _root.nmbr);
  27.                _root["enmBul" + _root.nmbr]._x = _X + 20;
  28.                _root["enmBul" + _root.nmbr]._y = _Y + 75;
  29.                _root["enmBul" + _root.nmbr].xspeed = 3;
  30.                _root["enmBul" + _root.nmbr].yspeed = 10;
  31.                _root.nmbr = _root.nmbr + 1;
  32.             }
  33.             _X = _X + xspeed;
  34.             if(_X > 460)
  35.             {
  36.                xspeed = -1 * speed;
  37.             }
  38.             if(_X < 90)
  39.             {
  40.                xspeed = speed;
  41.             }
  42.             pp = random(60);
  43.             if(pp <= 1 && speed == 3)
  44.             {
  45.                lc.play();
  46.             }
  47.             if(pp == 2 && lc._currentframe == 1)
  48.             {
  49.                speed = 15;
  50.                xspeed *= 2;
  51.                tt = 50;
  52.             }
  53.             tt -= 1;
  54.             if(tt <= 0)
  55.             {
  56.                speed = 3;
  57.             }
  58.          }
  59.          var i = 0;
  60.          while(i <= 20)
  61.          {
  62.             if(sh.harea.hitTest(_root["hmn" + i]))
  63.             {
  64.                life -= _root["hmn" + i].dmg;
  65.                sh.play();
  66.                removeMovieClip(_root["hmn" + i]);
  67.             }
  68.             if(lwing.hitTest(_root["hmn" + i]))
  69.             {
  70.                if(_root["hmn" + i].yspeed != 0)
  71.                {
  72.                   _root["hmn" + i].xspeed = -1 * _root["hmn" + i].yspeed * 2;
  73.                   _root["hmn" + i].yspeed = 0;
  74.                   _root["hmn" + i]._rotation = -90;
  75.                }
  76.             }
  77.             if(rwing.hitTest(_root["hmn" + i]))
  78.             {
  79.                if(_root["hmn" + i].yspeed != 0)
  80.                {
  81.                   _root["hmn" + i].xspeed = _root["hmn" + i].yspeed * 2;
  82.                   _root["hmn" + i].yspeed = 0;
  83.                   _root["hmn" + i]._rotation = 90;
  84.                }
  85.             }
  86.             i++;
  87.          }
  88.          if(_root.ship.sh.hitTest(sh.harea))
  89.          {
  90.             _root.ship.play();
  91.          }
  92.          if(_root.ship.sh.hitTest(lwing))
  93.          {
  94.             _root.ship.play();
  95.          }
  96.          if(_root.ship.sh.hitTest(rwing))
  97.          {
  98.             _root.ship.play();
  99.          }
  100.          if(_root.ship.sh.hitTest(lc.laz))
  101.          {
  102.             _root.ship.play();
  103.          }
  104.          if(life <= 0)
  105.          {
  106.             play();
  107.          }
  108.       }
  109.       if(_root.rem == true)
  110.       {
  111.          removeMovieClip(this);
  112.       }
  113.    }
  114. }
  115.